import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: () => import('../views/Tabbar.vue'),
    children: [
      {
        path: '',
        component: () => import('../views/index/Index.vue')
      },
      {
        path: '/wenda',
        component: () => import('../views/wenda/Index.vue')
      },
      {
        path: '/video',
        component: () => import('../views/video/Index.vue')
      },
      {
        path: '/me',
        component: () => import('../views/me/Index.vue')
      }
    ]
  },
  {
    path: '/login',
    component: () => import('../views/Login.vue')
  },
  {
    path: '/content/:id',
    component: () => import('../views/index/Content.vue')
  },
  {
    path: '/search',
    component: () => import('../views/index/Search.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
